package com.tianxiao.faas.common.util;

import java.util.Base64;

public abstract class Base64Utils {
    public static String encode(String str) {
        if (str == null) {
            return null;
        }
        byte[] encoded = Base64.getEncoder().encode(str.getBytes());
        return new String(encoded);
    }

    public static String decode(String str) {
        if (str == null) {
            return null;
        }
        byte[] decoded = Base64.getDecoder().decode(str);
        return new String(decoded);
    }
}
